<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-param" content="_csrf">
    <meta name="csrf-token" content="WY7W2tS08jsiodLBxW38sduRo0oHHtUniRpSAMOXAegI4J2FgN2YTk_1hK6qHdHVrvPFPDJqk0ToQCJlscFSgQ==">
    <title></title>
</head>

<body >

<form id="login-form" action="/user/security/login?tdsourcetag=s_pcqq_aiomsg" method="post">
<input type="hidden" name="_csrf" value="WY7W2tS08jsiodLBxW38sduRo0oHHtUniRpSAMOXAegI4J2FgN2YTk_1hK6qHdHVrvPFPDJqk0ToQCJlscFSgQ=="><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>登录</title>
    <link href="style.css" rel="stylesheet"></head>
<body>
<div class="login">
    <div class="login_box">
        <div class="login_title">
            <a href="#"><img src="logo.png" alt=""/></a>
            <h2>舜网会议活动报名Sass云平台</h2>
        </div>
        <div class="login_biaodan">
            <div class="kuang">
                <p>
                    <img src="icon_user.png" alt=""/>
                    <span>用户名：</span>
                </p>
                <input id="username"  name="username" type="text"/>
            </div>
            <div class="kuang">
                <p>
                    <img src="icon_pwd.png" alt=""/>
                    <span>密 &nbsp;&nbsp;码：</span>
                </p>
                <input type="password" id="password" name="password"/>
            </div>
            <input type="button" value="登录" class="submit" onclick="dologin();"/>
        </div>
    </div>
</div>
</form>
<script src="yii.js"></script>
<script src="yii.activeForm.js"></script>
<script src="../static/lib/jquery/jquery-1.12.min.js"></script>
<script src="../static/lib/store/store.min.js"></script>
<script src="../static/lib/jquery-validation/jquery.validate.min.js"></script>
<script src="../static/lib/jquery-ui/jquery-ui.min.js"></script>
<script src="../static/lib/sweetalert/sweetalert.min.js" type="text/javascript" ></script>
<script src="../static/lib/jquery-md5/jquery.md5.min.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.util.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.ajax.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.core.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.util.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.alert.swal.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.storage.js" type="text/javascript" ></script>
<script src="../static/lib/_zfes/zfes.permisison.js" type="text/javascript" ></script>
<script type="text/javascript">
		if('ontouchstart' in document.documentElement) document.write("<script src='static/libs/jquery/jquery.mobile.custom.js'>"+"<"+"/script>");
		</script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
		
			function convertPassword(password){
				var salt="zhtframework_94DABGioQOq2tTUO0AXYow";
				return hex_md5(salt+password);
			}
			
			function dologin(){
				var username = $.trim($("#username").val());
				var password = $.trim($("#password").val());
				if(username.length < 1){
					$("#error_show").empty();
					$("#error_show").html("<font color=\"red\">请输入用户名</font>");
					return;
				}
				if(password.length < 3){
					//$("#username").empty();
					//$("#password").empty();
					$("#password").val();
					$("#error_show").empty();
					$("#error_show").html("<font color=\"red\">请输入密码</font>");
					$("#password").focus();
					return;
				}
				 password=convertPassword(password);
				 console.log("password:"+password);
			    var ajaxUrl = "/api/auth/login";
				var param = { "username" : username,"password":password,"captcha":"验证码符号","loginOrgin":"PC"};
				
				zfesAjax.ajaxTodo(ajaxUrl, param, function(data) {
					if(data.statusCode==200){
						window.location.href="/index2.html";
						// zfesPermStore.initPerm("auth/loadAuthCodes",{},function(){window.location.href="index.html";});
						//登陆成功，写入权限缓存
						/* PermStore.setPermFromUrl(function(){
							var cs_token=data.data.cs_token;
							sessionStorage.setItem("cs_token",cs_token);
							var url="index.html";
						      
							//zfesUtil.locationWithParams(url,{"cs_token":cs_token});
						}); */
					}else{
						//alertMsg.error(data.message);
						$("#captchaz").empty();
						 refreshCaptcher();
						$("#error_show").html(data.message);
						$("#password").empty();
					}
				});  
			}
			$(function(){
				refreshCaptcher();
			}); 
		</script>
</html>
</body>
</html>
